package com.etcn.modules.busi.appconfig.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.etcn.common.annotation.Manage;
import com.etcn.common.controller.BaseController;
import com.etcn.modules.busi.appconfig.service.IAppVersionInfoService;

/**
 * App版本维护controller
 * @author guozc
 * @date: 2018-02-27 08:35:15
 */
@Controller
@RequestMapping("/v1/config")
public class AppVersionInfoController extends BaseController {

	@Autowired
    private IAppVersionInfoService appVersionInfoService;

     /**
     * 查询最新版本
     */
    @Manage
    @RequestMapping(value = "checkversion/{version:.+}", method = RequestMethod.GET)
    public @ResponseBody Object checkVersion(@PathVariable("version") String version) throws Exception{
    	return appVersionInfoService.checkVersion(version);
    }
    
    /**
     * 查询指数入口页展示tab
     */
    @Manage
    @RequestMapping(value = "exponententryconfig", method = RequestMethod.GET)
    public @ResponseBody Object getExponentEntryConfig() throws Exception{
    	return appVersionInfoService.getExponentEntryConfig();
    }
    
}